package satir.command;

/**
* Create the object of class EnterPlayerNameCmd
*
* @version 1.0 7 February 2012
* @author Bill Chan
*
*/

import java.util.Scanner;

import satir.SatirGame;

/**
 * The Class EnterPlayerFigureCmd.
 * 
 * @version 2.0 March 2012
 * @author Bill Chan
 */
public class EnterPlayerFigureCmd implements Command{
	
	/** The satir game. */
	private SatirGame satirGame;
	
	/**
	 * Instantiates a new enter player figure cmd.
	 *
	 * @param satirGame the satir game
	 */
	public EnterPlayerFigureCmd(SatirGame satirGame){
		this.satirGame = satirGame;
	}
	
	/* (non-Javadoc)
	 * @see stair.command.PlayerCmd#execute()
	 */
	public void execute() {
		String figure;
		Scanner scanner= new Scanner(System.in);
		for (int i = 0; i < satirGame.getNumOfPlayer(); i++) {
		System.out.println(satirGame.getCurrentPlayer().getName()+" please choice your figure:");
		figure = scanner.next(); //get the player figure from input
		System.out.println("[" + satirGame.getCurrentPlayer().getName() + "] your figure is "+ figure.charAt(0));
		
		satirGame.getPlayers(i).setFigure(figure.charAt(0));
		}
	}
}
